@page "/Stacked_Area_Chart"
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<Tabs>
    <TabPane Key="1">
        <Tab>示例1</Tab>
        <ChildContent>
            <StackedArea @ref="chart1" Data="data1" Config="config1" />
        </ChildContent>
    </TabPane>
</Tabs>

@code{

    IChartComponent chart1;
    OilItem[] data1;

    protected override async Task OnInitializedAsync()
    {
        data1 = await DemoData.OilAsync(NavigationManager, HttpClient);
        await chart1.ChangeData(data1);

        await base.OnInitializedAsync();
    }

    #region 示例1


    StackedAreaConfig config1 = new StackedAreaConfig()
    {
        Title = new Charts.Title()
        {
            Visible = true,
            Text = "堆叠面积图",
        },
        XField = "date",
        YField = "value",
        StackField = "country",
        Color = new string[] { "#6897a7", "#8bc0d6", "#60d7a7", "#dedede", "#fedca9", "#fab36f", "#d96d6f" },
        XAxis = new ValueCatTimeAxis()
        {
            Type = "dateTime",
            TickCount = 5,
        },
        Legend = new Legend()
        {
            Visible = true,
            Position = "right-top",
        },
        @*responsive = true,*@
    };


    #endregion 示例1

}



